package com.amin.avro;

import java.net.InetSocketAddress;

import org.apache.avro.ipc.NettyTransceiver;
import org.apache.avro.ipc.specific.SpecificRequestor;

import com.amin.avro.rpc.service.AddService;

public class Client {
	public static void main(String[] args) throws Exception {
		// 指定请求的ip地址和端口号
		NettyTransceiver client = new NettyTransceiver(new InetSocketAddress("127.0.0.1", 6666));
		AddService proxy = SpecificRequestor.getClient(AddService.class, client);
		int result = proxy.add(4, 3);
		System.out.println("客户端获取到计算结果：" + result);

		Student stu = new Student("rose", 23);
		proxy.sendStudent(stu);
	}
}
